<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <style>
      .box {
        width: 200px;
        height: 50px;
        text-align: center; /*文字水平居中*/
        line-height: 50px; /*文字垂直居中*/

        background-color: aquamarine;
      }
    </style>
  </head>
  <body>
    <div class="box">单行文本水平垂直居中</div>
  </body>
</html>
